package com.example.dao;

import com.example.domain.OrderDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailDao {
    @Insert("insert into order_detail (id,name,image,order_id,dish_id,dish_flavor,number,amount) values (#{id},#{name},#{image},#{orderId},#{dishId},#{dishFlavor},#{number},#{amount})")
    public void insertdish(OrderDetail orderDetail);

    @Insert("insert into order_detail (id,name,image,order_id,setmeal_id,number,amount) values (#{id},#{name},#{image},#{orderId},#{setmealId},#{number},#{amount})")
    public void insertsetmeal(OrderDetail orderDetail);

    @Select("select * from order_detail where order_id=#{id}")
    public List<OrderDetail> selectbyorder(Long id);
}
